﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="client.aspx.cs" Inherits="WebApplication1.client" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 291px;
        }
        #form1
        {
            height: 1px;
        }
    </style>
</head>
<body bgcolor="orange">

    <form id="form1" runat="server">
    <h2 style="color: #0000FF">
            <asp:HyperLink ID="HyperLink2" runat="server" allign="left" 
            NavigateUrl="~/Main.aspx">&lt;&lt;На главную</asp:HyperLink>
    </h2>
    <h2 style="color: #0000FF">Выберите клиента из списка:<asp:Label ID="Label2" 
            runat="server" Text="Label" Visible="False"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server" Visible="False">
        </asp:DropDownList>
    </h2>
    <h2>
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" 
            Font-Size="Large" ForeColor="#000099" BackColor="Yellow" 
            onselectedindexchanged="GridView1_SelectedIndexChanged">
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="Id" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Surname" HeaderText="Surname" 
                    SortExpression="Surname" />
                <asp:BoundField DataField="PassportSerial" HeaderText="PassportSerial" 
                    SortExpression="PassportSerial" />
                <asp:BoundField DataField="PassportNumber" HeaderText="PassportNumber" 
                    SortExpression="PassportNumber" />
                <asp:BoundField DataField="Birth" HeaderText="Birth" SortExpression="Birth" />
                <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            </Columns>
            <SelectedRowStyle BackColor="#33CC33" />
        </asp:GridView>
    <img src="47.gif" style="height: 96px; width: 114px" align="right"><asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" 
            DeleteCommand="DELETE FROM [Client] WHERE [Id] = @Id" 
            InsertCommand="INSERT INTO [Client] ([PassportSerial], [Birth], [PassportNumber], [Name], [Surname], [Phone], [Email]) VALUES (@PassportSerial, @Birth, @PassportNumber, @Name, @Surname, @Phone, @Email)" 
            SelectCommand="SELECT * FROM [Client]" 
            UpdateCommand="UPDATE [Client] SET [PassportSerial] = @PassportSerial, [Birth] = @Birth, [PassportNumber] = @PassportNumber, [Name] = @Name, [Surname] = @Surname, [Phone] = @Phone, [Email] = @Email WHERE [Id] = @Id">
            <DeleteParameters>
                <asp:Parameter Name="Id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="PassportSerial" Type="Int32" />
                <asp:Parameter Name="Birth" Type="String" />
                <asp:Parameter Name="PassportNumber" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Surname" Type="String" />
                <asp:Parameter Name="Phone" Type="Int32" />
                <asp:Parameter Name="Email" Type="String" />
                <asp:Parameter Name="Id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="PassportSerial" Type="Int32" />
                <asp:Parameter Name="Birth" Type="String" />
                <asp:Parameter Name="PassportNumber" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Surname" Type="String" />
                <asp:Parameter Name="Phone" Type="Int32" />
                <asp:Parameter Name="Email" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/NewClient.aspx">Или 
        добавьте нового&gt;</asp:HyperLink>
            <asp:Label ID="Label3" runat="server" Font-Size="X-Large" ForeColor="#006600" 
                Text="Новый договор успешно добавлен!!!" Visible="False"></asp:Label>
    </h2>
    <asp:Panel ID="Panel1" runat="server" Height="269px" Visible="False" 
        Width="442px">
    <table width="100%" style="height: 217px">
            <tr>
                <td class="style1" 
                    style="color: #0000FF; font-size: large; font-family: Arial;"> Данные об 
                    имуществе:</td>
            </tr>
          <tr>
                <td class="style1" style="font-size: large">
                    Номер сертификата собственности  
                </td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Адрес жилья 
                </td>
                <td>
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Последний этаж  
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox1" runat="server"  Text=""/>
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Количество комнат  
                </td>
                <td>
                    <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Площадь  
                </td>
                <td>
                    <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Год строительства  
                </td>
                <td>
                    <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Стоимость имущества  
                </td>
                <td>
                    <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>  
                </td>
            </tr>
            </table>
        <p style="margin-left: 360px">
            <asp:Button ID="Button2" runat="server" Text="Далее&gt;" 
                onclick="Button2_Click" />
        </p>
            
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" Height="426px" Width="462px" 
        Visible="False">
     <table style="height: 365px; width: 100%;">
            <tr>
                <td class="style1" 
                    style="color: #0000FF; font-size: large; font-family: Arial;"> Данные о 
                    договоре:</td>
            </tr>
          <tr>
                <td class="style1" style="font-size: large">
                    Страховка от огня  
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox3" runat="server"  Text=""/>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Страховка от затопления 
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox4" runat="server"  Text=""/>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Страховка от ограбления  
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox2" runat="server"  Text=""/>
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Проблемный договор  
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox5" runat="server"  Text=""/>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Включен износ  
                </td>
                <td>
                    <asp:CheckBox ID="CheckBox6" runat="server"  Text=""/>  
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Дата полиса  
                </td>
                <td>
                    <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
                </td>
            </tr><tr>
                <td class="style1" style="font-size: large">
                    Стоимость полиса  
                </td>
                <td>
                    <asp:TextBox ID="TextBox12" runat="server"></asp:TextBox>  
                </td>
            </tr>
            </table>
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            Text="Далее&gt;" />
        <p style="margin-left: 360px; height: 66px; width: 466px;">
            &nbsp;</p>
        <p style="margin-left: 360px; height: 66px; width: 466px;">
            &nbsp;</p>
    </asp:Panel>
    &nbsp;</form>
</body>
</html>
